<template>
  <div class="padding" style="margin-left:-16px;width:101.51%">
    <el-card>
      <div slot="header" class="clearfix relative">
        <span class="title-icon">运单信息</span>
      </div>
      <el-row :gutter="2">
        <el-col :span="24">
          <el-table ref="filterTable" :data="tableData" style="width: 100%">
            <el-table-column prop="waybillNo" label="运单号"></el-table-column>
            <el-table-column
              prop="referenceNo"
              label="参考号"
            ></el-table-column>
            <el-table-column
              prop="inStockActualWeight"
              label="实重"
            ></el-table-column>
            <el-table-column
              prop="inStockVolume"
              label="体积"
            ></el-table-column>
            <el-table-column
              prop="inStockChargedWeight"
              label="计费重"
            ></el-table-column>
            <el-table-column
              prop="inStockTotalPackages"
              label="件数"
            ></el-table-column>
            <el-table-column label="目的仓库类型">
              <template slot-scope="scope">
                {{
                  initOptionsData.stockTypeMap[scope.row.purposeWarehouseType]
                }}
              </template>
            </el-table-column>
            <el-table-column
              prop="dispatchAddressCode"
              label="仓库代码"
            ></el-table-column>
            <el-table-column
              prop="dispatcher"
              label="公司名/个人"
            ></el-table-column>
            <el-table-column
              prop="dispatchPhone"
              label="联系人"
            ></el-table-column>
            <el-table-column
              prop="dispatchProvince"
              label="州/省"
            ></el-table-column>
            <el-table-column prop="dispatchCity" label="城市"></el-table-column>
            <el-table-column
              prop="dispatchZipCode"
              label="邮编"
            ></el-table-column>
            <el-table-column
              prop="dispatchAddress"
              label="详细地址"
            ></el-table-column>
            <el-table-column prop="name" label="操作">
              <template slot-scope="scope">
                <el-button
                  v-if="verifyShow.extSinleDelete"
                  size="mini"
                  type="danger"
                  @click="deleteWaybillHdById(scope.$index, scope.row)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
import { ajax } from "@/store/yg/common/utils";
import axios from "axios";
import * as constant from "@/store/yg/common/constant";

export default {
  props: {
    verifyShow: {
      type: Object,
      default: function() {
        return {};
      }
    },
    pageType: {
      type: String,
      required: true
    },
    tableData: {
      type: Array,
      default: function(params) {
        return [];
      }
    },
    initOptionsData: {
      type: Object,
      default: function(params) {
        return {};
      }
    }
  },
  data() {
    return {};
  },
  mounted() {},
  methods: {
    deleteWaybillHdById(index, row) {
      var param = {};
      param["id"] = row.id;
      ajax("deleteWaybillHdById", param).then(
        res => {
          if (res.code != 200) {
            this.$message.error(res.message);
          } else {
            this.$message.success("删除成功!");
          }
          this.showdata = true;
        },
        error => {
          console.log(error);
        }
      );
    }
  }
};
</script>

<style></style>
